package com.gzyj.data.web.cljk;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

@Data
public class OrgCarTreeDTO implements Serializable {


    /**
     * 节点ID
     */
    @ApiModelProperty("节点ID 车辆ID或者组织ID")
    private String id;
    /**
     * 父节点
     */
    @ApiModelProperty("父节点ID")
    private String pid;

    /**
     * 节点名称
     */
    @ApiModelProperty("节点名称 车辆名称或者组织名称")
    private String label;

    /**
     * 节点状态
     */
    @ApiModelProperty("节点状态 0 从未上线 1 运行 2 停车 3 熄火 4 离线")
    private int status;

    /**
     * 节点类型
     */
    @ApiModelProperty("节点类型")
    private String type;
    /**
     * 报警状态
     */
    @ApiModelProperty("报警状态 0无报警 1 有报警")
    private int alarm;
    /**
     * 视频状态 1有视频 2无视频
     */
    @ApiModelProperty("视频状态 1有视频 2无视频")
    private int video;
    /**
     * 第三方视频播放地址
     */
    @ApiModelProperty("第三方视频播放地址")
    private String videoUrl;
    /**
     * 终端与平台连接方式  1直连 2 转发
     */
    @ApiModelProperty("终端与平台连接方式  1 直连 2 url转发 3 1078转发")
    private int connectType;

    @ApiModelProperty("acc状态  0 关闭 1 开启")
    private Integer acc;

    @ApiModelProperty("车牌")
    private String vehNo;
    @ApiModelProperty("车牌颜色")
    private String vehColor;
    @ApiModelProperty("是否直连 1 直连 2 转发")
    private Integer platformConnectType;

    @ApiModelProperty("sim卡号")
    private String simNo;

    @ApiModelProperty("报警明细")
    private String AlarmNote;

    @ApiModelProperty("视频通道数")
    private Integer videoChannelNum;

    /**
     * 节点车辆总数
     */
    @ApiModelProperty("节点车辆总数")
    private int totleNum;

    /**
     * 节点车辆上线数
     */
    @ApiModelProperty("节点车辆上线数")
    private int onlineNum;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<OrgCarTreeDTO> children;


    public OrgCarTreeDTO() {

    }

    public OrgCarTreeDTO(String id, String label, String pid) {
        this.id = id;
        this.label = label;
        this.pid = pid;
        this.children = new ArrayList<>();
        this.totleNum = 0;
        this.onlineNum = 0;
        this.type = "dept";
    }

    public OrgCarTreeDTO(String id, String label, String pid, String flag) {
        this.id = id;
        this.label = label;
        this.pid = pid;
        this.children = new ArrayList<>();
        this.totleNum = 0;
        this.onlineNum = 0;
        this.type = "area";
    }


}
